package com.kapo.egroup.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kapo.egroup.entity.base.project.Project;
import com.kapo.egroup.entity.base.recruit.Recruit;
import com.kapo.egroup.entity.base.talent.Talent;
import com.kapo.egroup.mapper.RecruitMapper;
import com.kapo.egroup.mapper.TalentMapper;
import com.kapo.egroup.service.RecruitService;
import com.kapo.egroup.service.TalentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title TalentServiceImpl
 * @Description TODO
 * @Author 86159
 * @Date 2023-04-01 14:44
 **/
@Service
public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> implements RecruitService {

    @Autowired
    RecruitMapper recruitMapper;

    @Override
    public List<Recruit> getRecruitAll() {
        QueryWrapper<Recruit> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("_id","leader_id","project_id","description","requirement");
//        return baseMapper.selectList(queryWrapper);
        return recruitMapper.getRecruitList();
    }

    @Override
    public void updateRecruit(Recruit recruit) {
        QueryWrapper<Recruit> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("_id",recruit.getId());
        baseMapper.update(recruit, queryWrapper);
    }
}
